#pragma once
// 航班信息：
#include <string>
#include <chrono>
#include <map>
#include <vector>
#include <QMetaType>

using namespace std;


class Trip {
public:
	//基础信息
	Trip();
	~Trip();

	//CRUD
	bool AddTrip(
		unsigned int tripId, unsigned int planeId, 
		string takeOffCity, string fallCity, double price,
		string takeOffTime,
		string fallTime);
	bool DeleteTrip(unsigned int tripId);
	bool ModifyTrip(unsigned int tripId, map<string, string> entry);
	Trip SearchTrip(unsigned int tripId);

	// 查询所有航班
	vector<Trip> SearchAllTrip();
	
	// 成员变量访问和修改函数
	unsigned int getTripId() const;
	void setTripId(unsigned int id);

	unsigned int getPlaneId() const;
	void setPlaneId(unsigned int id);

	string getTakeOffCity() const;
	void setTakeOffCity(const string& city);

	string getFallCity() const;
	void setFallCity(const string& city);

	double getPrice() const;
	void setPrice(double p);

	string getTakeOffTime() const;
	void setTakeOffTime(const string& time);

	string getFallTime() const;
	void setFallTime(const string& time);

private:
	unsigned int tripId;
	unsigned int planeId;
	string takeOffCity;
	string fallCity;
	double  price;
	string takeOffTime;
	string fallTime;
};

